Image encoding device, image decoding device, and image processing method

ABSTRACT

An image encoding device is provided that performs, in an image, an intra-prediction on a block obtained by dividing the image so as to encode the block, the image encoding device including: a memory; and a processor coupled to the memory and the processor configured to select a rectangular block as the block, and to add a certain prediction direction as a selection target intra-prediction direction when the rectangular block is selected, wherein the certain prediction direction is one of prediction directions in which a pixel that is adjacent to a short side of the rectangular block is referred to, and an adjacent pixel in a left or upper block that is adjacent to a long side of the rectangular block is referred to in another prediction direction that is 180 degrees opposite to the certain prediction direction.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a divisional of U.S. application Ser. No.16/059,448, filed on Aug. 9, 2018 which is based upon and claims thebenefit of priority of the prior Japanese Patent Application No.2017-159965, filed on Aug. 23, 2017, the entire contents of which areincorporated herein by reference.

FIELD

The embodiments discussed herein are related to an image encodingdevice, an image decoding device, and an image processing method.

BACKGROUND

An intra-prediction is used for H.264/AVC (an international standardvideo compression scheme for a video) and for HEVC (ISO/IEC 23008: HighEfficiency Video Coding). In the intra-prediction, a frame image isdivided into blocks, and a prediction mode is selected that indicateshow to perform an intra-prediction on a processing target block in theframe image from pixels in an encoded left adjacent block in the frameimage and in an encoded upper adjacent block in the frame image(adjacent pixels). Then, an intra-prediction is performed using theselected prediction mode, so as to generate a prediction image of theprocessing target block. Next, in the processing target block, aprediction residual (prediction error) signal that corresponds to adifference between an original image and the prediction image. Theprediction residual signal is transformed into a signal in the spatialfrequency domain using the discrete cosine transform (DCT) or thediscrete wavelet transform (DWT), and the signal in the spatialfrequency domain is then quantized. Using an entropy coding, thequantized signal is binarized together with information on theprediction mode used for the intra-prediction, and is output as anencoded image signal. The similar coding scheme is applicable to a stillimage.

In HEVC, coding is performed for each block called a coding unit (CU).Each CU is divided into blocks each of which is called a prediction unit(PU) and on which a prediction is performed, and the PU is used for anintra-prediction. Video coding standards before the HEVC standard applyrecursive processing in which it is determined whether a quad-treepartitioning is to be performed to divide a CU. Further, with respect toa PU that is a unit on which an intra-prediction is performed, videocoding standards before the HEVC standard also apply processing in whichit is determined whether the size of a CU is to be unchanged or the CUis to be divided using a quad-tree partitioning. Thus, all of the blocksobtained by division have a square shape. On the other hand, the JointVideo Exploration Team (JVET) jointly established by the ISO/IECSC29/WG11 (MPEG) and the ITU-T SG16 WP3/Q6 (VCEG) conducts researches ona next-generation video coding. Block partitioning called the quad-treeplus binary tree (QTBT) block partitioning which makes it possible toperform not only a quad-tree block division but also a binary tree blockdivision to divide a CU has been proposed in the JVET. When the QTBTblock partitioning is used, a binary tree block division can beperformed on a CU to generate a PU, and this results in being able toselect not only a square block but also a rectangular block as a PUblock.

As described above, when an intra-prediction is used, a prediction imagefor a processing target block is generated using adjacent pixels in anencoded left adjacent block and in an encoded upper adjacent block, sothere is a demand for a technology that efficiently performs anintra-prediction on a rectangular block from adjacent pixels.

The following technology is known as a conventional technology thatperforms an intra-prediction efficiently (see, for example, JapaneseLaid-open Patent Publication No. 2016-027756). First, a reference pixelsignal is set from a decoded pixel signal in intra-prediction in which aprediction signal is generated in the same frame. Next, prediction modeidentification information that identifies a prediction mode isacquired. Next, a prediction signal is generated based on the referencepixel signal and the prediction mode identification information. Next,in the prediction mode identified by the prediction mode identificationinformation, a determination regarding correction of the predictionsignal is performed using a reference pixel having a shorter distancefrom a prediction target pixel. Further, the generated prediction signalis corrected according to a result of the determination. Thedetermination includes determining a correction range of the predictiontarget pixel from a parameter indicating a shape of a function, thefunction being defined using a decoded pixel adjacent to the upper leftside of a prediction target block as an origin. In this configuration,an decoded reference pixel situated closer to a prediction target pixelis used to generate a prediction signal when an intra-prediction isused, which results in being able to reduce a prediction residual energyand to improve a subjective image quality and an encoding efficiency.

As described above, in an intra-prediction before the HEVC standard, allof the processing target block have a square shape, so there is nodifference in distance between a prediction from a left adjacent pixeland a prediction from a an upper adjacent pixel. However, such arelationship will be changed if it is possible to use a processingtarget block having a rectangular shape due to the usage of theabove-described QTBT block partitioning and an intra-prediction isperformed on the rectangular block. For example, in the case of ahorizontally long rectangular block, a left adjacent pixel is situatedaway from a respective prediction target pixel in the rectangular block.On the other hand, in the case of a vertically long rectangular block,an upper adjacent pixels is situated away from a respective predictiontarget pixel in the rectangular block.

Thus, conventionally, if an intra-prediction is performed on arectangular block and a prediction image is generated using distantadjacent pixels, there will be a decrease in prediction efficiency andan energy of the prediction residual signal described above will be morelikely to be increased. This results in a decrease in encodingefficiency.

In the conventional technology described above that corrects aprediction target pixel from a parameter indicating a shape of afunction, there is a need to encode a number that identifies correctioninformation or a parameter indicating a shape of a function and totransmit it to the decoding side, in order to improve an encodingperformance. This may result in a decrease in transmission efficiency.

SUMMARY

According to an aspect of the invention, an image encoding deviceaccording to embodiments performs, in an image, an intra-prediction on ablock obtained by dividing the image so as to encode the block. Theimage encoding device includes a memory and a processor coupled to thememory.

The processor selects a rectangular block as the block.

The processor adds a certain prediction direction as a selection targetintra-prediction direction when the rectangular block is selected,wherein the certain prediction direction is one of prediction directionsin which a pixel that is adjacent to a short side of the rectangularblock is referred to, and an adjacent pixel in a left or upper blockthat is adjacent to a long side of the rectangular block is referred toin another prediction direction that is 180 degrees opposite to thecertain prediction direction.

The object and advantages of the invention will be realized and attainedby means of the elements and combinations particularly pointed out inthe claims.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory and arenot restrictive of the invention, as claimed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an intra-prediction performed on a square block;

FIG. 2 illustrates prediction modes used for HEVC;

FIG. 3A is a diagram for explaining a relationship of a rectangularblock with a distance between an adjacent pixel and a correspondingpixel in the rectangular block;

FIG. 3B is a diagram for explaining a relationship of a rectangularblock with a distance between an adjacent pixel and a correspondingpixel in the rectangular block;

FIG. 4 is a diagram for explaining the case in which embodiments areapplied to the prediction modes used for HEVC;

FIG. 5 illustrates blocks used for HEVC;

FIG. 6 is a block diagram that illustrates an example of a configurationof a video encoding device according to the embodiments;

FIG. 7 is a flowchart that illustrates an example of encoding processingthat is focused on an intra-prediction and performed by the videoencoding device;

FIG. 8 is a diagram for explaining an operation of calculating adistance performed by a prediction direction determination unit;

FIG. 9 is a block diagram that illustrates an example of a configurationof a video decoding device according to the embodiments;

FIG. 10 is a flowchart that illustrates an example of decodingprocessing that is focused on an intra-prediction and is performed bythe video decoding device; and

FIG. 11 is an example of a hardware configuration of a computer that canbe implemented as a video encoding device or a video decoding device.

DESCRIPTION OF EMBODIMENTS

An intra-prediction and a prediction mode are described beforeembodiments of the present invention are described in detail.

As described above, video coding standards before the HEVC standardapply recursive processing in which it is determined whether a quad-treepartitioning is to be performed to divide a CU. Further, with respect toa PU that is a unit on which an intra-prediction is performed, videocoding standards before the HEVC standard also apply processing in whichit is determined whether the size of a CU is to be unchanged or the CUis to be divided using a quad-tree partitioning. Thus, all of the blocksobtained by division have a square shape. FIG. 1 illustrates anintra-prediction performed on such a square block. For example,prediction is performed on a PU that is an 8×8 block of white pixels,using adjacent dark-color pixels that are located adjacent to the PU onthe left side and on the upper side of the PU. As indicated by thedirection of each arrow in FIG. 1, different schemes are used todetermine weighting of a prediction image that is calculated usingadjacent pixels. A maximum of 10 different prediction modes are used forH.264/AVC (international standard video compression scheme), and amaximum of 35 different prediction modes are used for High EfficiencyVideo Coding (HEVC).

FIG. 2 illustrates prediction modes used for HEVC. For HEVC, aprediction mode can be selected from a total of 35 prediction modes eachhaving a respective mode number illustrated in FIG. 2, including aplanar prediction with mode No. 0, a DC prediction with mode No. 1, andangular predictions with mode No. 2 to mode No. 34. In the planarprediction with mode No. 0, each prediction pixel in a PU is generatedfrom a planar approximation of encoded adjacent pixels situated on theleft side and on the upper side of the PU. In the DC prediction withmode No. 1, each prediction pixel in a PU is generated as an average ofencoded adjacent pixels situated on the left side and on the upper sideof the PU. In the angular predictions with mode No. 2 to mode No. 34, acentrally located prediction pixel is generated from adjacent pixelseach situated in a position indicated by a respective arrow from amongthe arrows with the numbers 2 to 34 from lower left corner to upperright, as illustrated in FIG. 2. As can be seen in FIG. 2, there are 33prediction modes for the angular prediction.

In a conventional intra-prediction that uses prediction modesillustrated in FIG. 1 or 2, all of the processing target block PU have asquare shape, so there is no difference in distance between a predictionfrom a line of left adjacent pixels and a prediction from a line ofupper adjacent pixels. On the other hand, as described above, the QTBTblock partitioning that makes it possible to use a binary tree blockdivision in addition to a quad-tree block division to divide a CU hasbeen proposed in the JVET, where not only a square block but also arectangular block can be selected as a PU block. This results in animprovement in encoding performance. However, the usage of a rectangularblock in the QTBT block partitioning changes the above-describedrelationship in which there is no difference in distance between aprediction from a left adjacent pixel and a prediction from an upperadjacent pixel. FIGS. 3A and 3B are diagrams for explaining arelationship of a rectangular block with a distance between an adjacentpixel and a corresponding pixel in the rectangular block. As illustratedin FIG. 3A, when a rectangular block 301 that is a PU has a horizontallylong shape, there is a great distance from each prediction target pixelin rectangular block 301 to a respective left adjacent pixel 302, asindicated by the arrows in FIG. 3A. On the other hand, as illustrated inFIG. 3B, when the rectangular block 301 has a vertically long shape,there is a great distance from each prediction target pixel in therectangular block 301 to a respective upper adjacent pixel 303, asindicated by the arrows in FIG. 3B. If a prediction image is generatedfrom distant adjacent pixels in an intra-prediction, as illustrated inFIGS. 3A and 3B, there will be a decrease in prediction efficiency andan energy of a prediction residual signal will be more likely to beincreased. This results in a decrease in encoding efficiency.

As illustrated in FIG. 3A, if the rectangular block 301 is farther awayfrom a line of left adjacent pixels 302, the rectangular block 301 iscloser to a line of upper adjacent pixels 303. On the other hand, asillustrated in FIG. 3B, if the rectangular block 301 is farther awayfrom the line of upper adjacent pixels 303, the rectangular block 301 iscloser to the line of left adjacent pixels 302.

Thus, in the embodiments described below, when a PU is a rectangularblock, the following processing is performed every time a predictionmode is evaluated. In addition to an intra-prediction from a predictiondirection that corresponds to the prediction mode (hereinafter referredto as an “original prediction direction”), an intra-prediction from adirection that is 180 degrees opposite to the original predictiondirection (hereinafter referred to as an “opposite predictiondirection”) is also evaluated. Then, a prediction direction that hasbeen highly evaluated is selected so that an operation that improves aprediction efficiency in intra-prediction is performed.

If a PU includes an edge pixel whose edge is sufficiently strong to passthrough the PU, both an intra-prediction from a lower left direction andan intra-prediction from an upper right direction that is 180 degreesopposite to the lower left direction are correct. When anintra-prediction is performed, the prediction efficiency is expected tobe higher if an adjacent pixel and a prediction target pixel aresituated closer to each other. On the other hand, it is preferable thatan increase in the number of directions of an intra-prediction (thenumber of prediction modes) be prevented as much as possible in light ofencoding efficiency.

Thus, in the embodiments described below, the following control isperformed. When, in addition to an intra-prediction from an originalprediction direction, an intra-prediction from a prediction directionopposite to the original prediction direction can also be performed withrespect to a certain prediction mode, and when an adjacent pixel and aprediction target pixel are situated closer to each other in theopposite prediction direction than in the original prediction direction,the prediction direction is changed to the opposite prediction directionand the prediction mode is determined in the opposite predictiondirection. Accordingly, an intra-prediction is performed moreefficiently in the embodiments.

The following is the point of the embodiments. When an intra-predictionis performed on a rectangular block, a certain prediction direction (forexample, a prediction direction from lower left to upper right) and aprediction direction opposite to the certain prediction direction (forexample, a prediction direction from upper right to lower left) areevaluated at the same time.

FIG. 4 is a diagram for explaining the case in which the embodiments areapplied to the prediction modes used for HEVC illustrated in FIG. 2.With respect to a prediction mode that has a certain predictiondirection from lower left to upper right (such as the angular predictionmodes with mode No. 3 to mode No. 9 from among the angular predictionmodes with mode No. 2 to mode No. 34), a prediction direction that is180 degrees opposite to the certain prediction direction is defined. Forexample, when a prediction target pixel is used as a reference, theprediction direction from lower left to upper right is a direction of acounterclockwise angle that is greater than 180 degrees and less than225 degrees, with the horizontally right direction being 0 degrees. Theprediction directions that are 180 degrees opposite to the predictiondirections from lower left to upper right are prediction directions withmode No. 3′ to mode No. 9′ (the numbers from 3′ to 6′ are indicated inthe figure) that are obtained by extending a line of upper adjacentpixels with mode No. 18 to mode No. 34 in the horizontally rightdirection.

Further, with respect to a prediction mode that has a certain predictiondirection from upper right to lower left (such as the prediction modeswith mode No. 33 to mode No. 27), a prediction direction that is 180degrees opposite to the certain prediction direction is also defined,although this is not illustrated. For example, when the predictiontarget pixel is used as a reference, the prediction direction from upperright to lower left is a direction of a counterclockwise angle that isgreater than 45 degrees and less than 90 degrees, with the horizontallyright direction being 0 degrees. The prediction directions that are 180degrees opposite to the prediction directions from upper right to lowerleft are prediction directions with mode No. 33′ to mode No. 27′ (notillustrated) that are obtained by extending a line of upper adjacentpixels with mode No. 33 to mode No. 27 in the vertical direction.

In the embodiments, an appropriate intra-prediction is performed byimplicitly determining (by determining without any increase in codeamount) which of the two prediction directions defined as describedabove generates a better prediction image. When the determinationdescribed above is performed in accordance with the same algorithm in animage encoding device and an image decoding device, this makes itpossible to perform an intra-prediction in an original predictiondirection on the encoding side so as to encode a prediction mode thatcorresponds to the original prediction direction, and to perform,according to conditions, an intra-prediction in another predictiondirection on the decoding side, the another prediction direction being aprediction direction opposite to the original prediction direction.

The following are basic operations of the embodiments described below.

Step 1: A distance between an adjacent pixel and a prediction targetpixel in a processing target block is defined.

Step 2: If it is possible to perform an intra-prediction from aprediction direction that is opposite to an original predictiondirection that corresponds to a certain prediction mode, the followingprocessing will be performed. The distance of Step 1 that is calculatedusing an adjacent pixel in the original prediction direction is comparedwith the distance of Step 1 that is calculated using an adjacent pixelin the opposite prediction direction described above, and a directionwith a smaller distance is selected.

Step 3: The direction selected in Step 2 is determined to be aprediction direction that corresponds to a current prediction mode.

An exact distance will be calculated in Step 1 described above ifdistances between all of the prediction target pixels in the processingtarget block and an adjacent pixel in the currently selected directionare summed. Alternatively, instead of the sum calculated as describedabove, it is also possible to use a sum of distances between predictiontarget pixels on the upper left corner and on the lower right corner inthe processing target block and the adjacent pixel, or to only use adistance between a prediction target pixel on the lower right corner inthe processing target block and the adjacent pixel, in order to reduce acalculation amount.

The embodiments based on the basic operations described above isdescribed in detail with reference to the drawings.

FIG. 5 illustrates blocks used for HEVC that are applied in theembodiments. In HEVC, a picture is divided into encoding target blocks(coding tree units: CTUs), and the CTUs are encoded in order of rasterscanning. The CTU size remains unchanged for each sequence, and can beselected from pixel sizes between 64×64 pixels and 16×16 pixels.Further, the CTU is divided into first sub-block CUs with a quad-treestructure, and the CUs are encoded in order of raster scanning for eachCTU. The CU has a variable size, and the CU size can be selected frompixel sizes of CU partitioning modes of 8×8 pixels and 64×64 pixels. TheCU is a unit used to select the coding mode between an intra-predictionand an inter-prediction. The CU is processed for each second sub-blockPU and is also processed for each third sub-block TU (transform unit).The PU is a unit on which prediction is performed in each coding mode.For example, the PU is a unit used to determine the intra-predictionmode when an intra-prediction is performed. The PU is a unit used toperform a motion compensation when an inter-prediction is performed. Forexample, when an inter-prediction is performed, the PU size can beselected from pixel sizes of PU partitioning modes (PartMode) of 2N×2N,N×N, 2N×N, N×2N, 2N×U, 2N×nD, nR×2N, and nL×2N. On the other hand, theTU is a unit used for an orthogonal transform performed by an orthogonaltransform/quantization unit 610 of FIG. 6 described later, and the TUsize can be selected from pixel sizes between 4×4 and 32×32. The TU isdivided with a quad-tree structure, and division blocks are processed inorder of raster scanning.

FIG. 6 is a block diagram that illustrates an example of a configurationof a video encoding device according to the embodiments. A videoencoding device 600 illustrated in FIG. 6 includes anadjacent-pixel-line extension unit 601, a prediction directiondetermination unit 602, an intra-prediction mode determination unit 603,an intra-prediction unit 604, a motion vector detector 605, a motioncompensation unit 606, a mode determination unit 607, and a predictionimage generator 608. The video encoding device further includes aresidual calculator 609, the orthogonal transform/quantization unit 610,a variable length coding unit 611, an inverse quantization/inverseorthogonal transform unit 612, a reference image calculator 613, and aframe memory 614.

In FIG. 6, inter-prediction processing and intra-prediction processingare performed on an image for each CU described in FIG. 5 (hereinafterreferred to as a “processing target CU”) and for each PU obtained bydividing the CU (hereinafter referred to as a processing target PU), theimage being input from an input unit (not illustrated).

The inter-prediction processing on a processing target CU and aprocessing target PU obtained by diving the processing target CU isperformed by the motion vector detector 605 and the motion compensationunit 606. First, the motion vector detector 605 receives an input of animage of a current frame (hereinafter referred to as an “originalimage”), and also receives, from the frame memory 614, an input of areference image that is an encoded locally-decoded image (describedlater) generated in the video encoding device 600. The motion vectordetector 605 cuts processing target CUs of the same portion out of theoriginal image and the reference image, respectively. The motion vectordetector 605 further cuts a PU of the same portion out of the originalimage and the reference image, respectively, the PU corresponding to aprocessing target PU obtained by dividing the processing target CU (thePU cut out of the original image is referred to as an “original imagePU” and the PU cut out of the reference image is referred to as a“reference image PU”). The motion vector detector 605 calculates anabsolute difference between a pixel of the original image PU and acorresponding pixel of the reference image PU. The motion vectordetector 605 calculates a sum-of-absolute differences SAD_cost (SumAbsolute Difference) with respect to the calculated absolute differencesof the respective pixel pairs. For example, when the PU has a16×16-pixel size, SAD_cost is an accumulation value of the calculatedabsolute differences described above with respect to a total of 256pixels along a raster scan line from the upper left corner to the lowerright corner, and is calculated using Formula (1) below.SAD_cost=Σ|*org−*ref|  (1)

Here, “*org” represents each pixel value of an original image PU, and“*ref” represents each pixel value of a reference image PU.

The motion vector detector 605 performs a motion search according to thecalculated sum-of-absolute differences SAD_cost, and searches for anoptimal motion vector using, for example, a minimum value of thecalculated sum-of-absolute differences. In general, not only a magnitudeof a sum-of-absolute differences between pixels, but also an evaluationvalue of a motion vector is taken into consideration when a motionsearch is performed. When a certain motion vector of a certain PU isencoded, a component of the certain motion vector itself is not encoded,but a difference vector corresponding to a difference between thecertain motion vector and a motion vector of a neighboring PU of thecertain PU is encoded. Thus, the motion vector detector 605 calculates adifference vector corresponding to a difference between an encodingtarget motion vector of a certain PU and a motion vector of aneighboring PU of the certain PU, and outputs an evaluation value thatcorresponds to a code length of the encoding target motion vectoraccording to a magnitude of a component of the difference vector. Here,an evaluation value of a motion search is represented by “cost”, and anevaluation value that corresponds to a code amount of a motion vector isrepresented by MV_cost (Motion Vector). The motion vector detector 605searches for a motion vector position in which “cost” calculated usingFormula (2) below by use of MV_cost described above and thesum-of-absolute differences SAD_cost calculated using Formula (1) has aminimum value. Here, λ is a Lagrange multiplier.cost=SAD_cost+λ×MV_cost  (2)

Actually, a PU may have a pixel size between 64×64 and 4×4, so a unitused to evaluate “cost” may be changed according to the pixel size ofthe PU.

Instead of SAD_cost described above, another evaluation value such asSATD (a differential cost obtained by performing the Hadamard transform)may also be used.

Next, the motion compensation unit 606 performs a motion compensationfor a current processing target PU according to a motion vector detectedby the motion vector detector 605. The motion compensation unit 606applies the motion vector detected by the motion vector detector 605 toa reference image PU read by the motion vector detector 605 from theframe memory 614. Then, the motion compensation unit 606 generates a PUof a prediction image (hereinafter referred to as a “prediction imagePU”) that corresponds to an original image PU, and determines it as aprediction image PU obtained by performing an inter-prediction. Themotion compensation unit 606 combines all of the prediction image PUs ofthe entire processing target CU, so as to generate a prediction image CUobtained by performing an inter-prediction on the processing target CUand to output the prediction image CU, each prediction image PU beingobtained by performing an inter-prediction for each processing targetPU.

On the other hand, intra-prediction processing on a processing target CUand a processing target PU obtained by diving the processing target CUis performed by the adjacent-pixel-line extension unit 601, theprediction direction determination unit 602, the intra-prediction modedetermination unit 603, and the intra-prediction unit 604 of FIG. 6.

First, when a processing target PU obtained by dividing a processingtarget CU is a rectangular block, the adjacent-pixel-line extension unit601 performs the following processing. When the rectangular block has ahorizontally long shape, the adjacent-pixel-line extension unit 601extends a line of upper adjacent pixels of the rectangular block up to apixel included in an upper block that is adjacent to an extensionobtained by extending a long side of the rectangular block in ahorizontally right direction (refer to the description of FIG. 4). Whenthe rectangular block has a vertically long shape, theadjacent-pixel-line extension unit 601 extends a line of left adjacentpixels of the rectangular block up to a pixel included in a left blockthat is adjacent to an extension obtained by extending a long side ofthe rectangular block in a vertically downward direction. As an adjacentpixel value, the adjacent-pixel-line extension unit 601 uses a value ofa pixel in a corresponding position of the reference image read from theframe memory 614.

Next, when the processing target PU is a rectangular block, theprediction direction determination unit 602 performs the operations ofSteps 1, 2, and 3 described in FIG. 4 using the adjacent pixel value setby the adjacent-pixel-line extension unit 601, so as to select, for eachprediction mode, one of an original prediction direction thatcorresponds to the prediction mode and an opposite prediction direction.

Taking into consideration the determination performed by the predictiondirection determination unit 602, the intra-prediction modedetermination unit 603 determines an intra-prediction mode for theprocessing target PU. While changing the intra-prediction modesequentially (the 35 prediction modes illustrated in FIG. 2 in the caseof HEVC), the intra-prediction mode determination unit 603 refers to anadjacent pixel in an intra-prediction direction based on thedetermination performed by the prediction direction determination unit602 with respect to a current intra-prediction mode. Next, theintra-prediction mode determination unit 603 determines a tentativeprediction value of each pixel of the processing target PU from acorresponding adjacent pixel to which the intra-prediction modedetermination unit 603 referred (the PU constituted of tentativeprediction values of respective pixels is hereinafter referred to as a“tentative prediction image PU”). The intra-prediction modedetermination unit 603 calculates a sum-of-absolute differences SAD_costbetween pixels of an original image PU and respective pixels of atentative prediction image PU with respect to the currentintra-prediction mode, as calculated using Formula (1) described above.Further, the intra-prediction mode determination unit 603 calculates a“cost” value that corresponds to the current intra-prediction mode usingthe calculated sum-of-absolute differences SAD_cost, as calculated usingFormula (2). The intra-prediction mode determination unit 603 performsthese calculations on all of the intra-prediction modes, and determinesan intra-prediction mode with which the “cost” value becomes minimal tobe an intra-prediction mode for the processing target PU.

The intra-prediction unit 604 of FIG. 6 determines, to be a predictionimage PU obtained by performing an intra-prediction, the tentativeprediction image PU calculated by the intra-prediction modedetermination unit 603 for the intra-prediction mode determined by theintra-prediction mode determination unit 603. The intra-prediction unit604 combines all of the prediction image PUs of the entire processingtarget CU, so as to generate a prediction image CU obtained byperforming an intra-prediction on the processing target CU and to outputthe prediction image CU, each prediction image PU being obtained byperforming an intra-prediction for each processing target PU.

The mode determination unit 607 of FIG. 6 compares the prediction imageCU generated by the motion compensation unit 606 using aninter-prediction with the prediction image CU generated by theintra-prediction unit 604 using an intra-prediction. The modedetermination unit 607 determines, from the comparison, which of aninter-prediction and an intra-prediction is more appropriate forencoding the current processing target CU. When the mode determinationunit 607 has determined that it is more appropriate to perform aninter-prediction, the mode determination unit 607 outputs the predictionimage CU generated by the motion compensation unit 606 to the predictionimage generator 608. When the mode determination unit 607 has determinedthat it is more appropriate to perform an intra-prediction, the modedetermination unit 607 outputs the prediction image CU generated by theintra-prediction unit 604 to the prediction image generator 608. Theprediction image generator 608 outputs the prediction image CU inputfrom the mode determination unit 607 to the residual calculator 609.

The residual calculator 609 of FIG. 6 calculates a difference betweeneach pixel in an original image that corresponds to the currentprocessing target CU (hereinafter referred to as an “original image CU”)and a corresponding pixel in the prediction image CU output by theprediction image generator 608, so as to generate a CU of a predictionresidual image (hereinafter referred to as a “prediction residual imageCU”).

The orthogonal transform/quantization unit 610 of FIG. 6 performs theorthogonal DCT transform, or the orthogonal Hadamard transform dependingon the coding mode, on the prediction residual image CU for each TU size(refer to the description of FIG. 5), so as to transform the predictionresidual image CU into a spatial-frequency-component signal. When animage is transformed into a spatial-frequency-component, a signal isgathered in a low frequency component due to a spatial correlativity ofan image, so as to compress information. The orthogonaltransform/quantization unit 610 performs sampling on a value obtained byperforming the orthogonal transform, so as to increase the number ofcomponents whose coefficient value is zero.

The variable length coding unit 611 of FIG. 6 performs a variable lengthcoding on only a coefficient that has become nonzero due to quantizationperformed by the orthogonal transform/quantization unit 610, and outputsthe variable-length-coded coefficient. The variable length coding unit611 performs coding called the CABAC which calculates an optimal codeallocation corresponding to the probability of occurrence. This makes itpossible to shorten a code length overall for any encoded bit string.

The inverse quantization/inverse orthogonal transform unit 612 of FIG. 6performs an inverse quantization on the coefficient quantized by theorthogonal transform/quantization unit 610, and further performs aninverse orthogonal transform on a frequency component on which aninverse quantization has been performed, so as to transform thefrequency component into a locally decoded prediction residual image.

The reference image calculator 613 of FIG. 6 adds, for each CU, a pixelvalue of the prediction image CU generated by the prediction imagegenerator 608 to a corresponding pixel value of the locally decodedprediction residual image output by the inverse quantization/inverseorthogonal transform unit 612. Accordingly, the reference imagecalculator 613 generates a locally decoded reference image CU, andaccumulates the locally decoded reference image CUs in the frame memory614.

As described above, a processing target image that is identical to theprocessing target image generated on the decoding side is also generatedon the encoding side. The image generated on the encoding side isreferred to as a locally decoded image, and it is possible to perform adifferential encoding on subsequent frame images by generating, on theencoding side, a processing target image that is identical to theprocessing target image on the decoding side.

FIG. 7 is a flowchart that illustrates an example of encoding processingthat is focused on an intra-prediction and performed by the videoencoding device 600 of FIG. 6. The flowchart is described belowreferring to each component of FIG. 6 as needed.

First, the adjacent-pixel-line extension unit 601 divides a currentlyset processing target CU into processing target PUs, determines one ofthe processing target PUs, and determines whether the processing targetPU is a rectangular division PU or not (a square division PU) (StepS701). When a conventional coding scheme before HEVC is applied, or whenall of the units on which an intra-prediction is to be performed have asquare shape even if the QTBT block partitioning is used, it isdetermined to be NO.

When the determination of a rectangular division in Step S701 is YES,the adjacent-pixel-line extension unit 601 performs the above-describedprocessing of extending a line of adjacent pixels (Step S702). When thedetermination of a rectangular division in Step S701 is NO, theadjacent-pixel-line extension unit 601 skips the process of Step S702.

Next, one intra-prediction mode is selected by a controller (notillustrated) for the processing target PU (Step S703). In the case ofHEVC, the intra-prediction mode is one of the 35 intra-prediction modesillustrated in FIG. 2.

Next, with respect to the intra-prediction mode selected in Step S703,the prediction direction determination unit 602 determines whether it ispossible to use a prediction direction (abbreviated to “oppositedirection” in FIG. 7) that is opposite to an original predictiondirection that corresponds to the selected intra-prediction mode. Itwill be determined to be YES if all of the following conditions aresatisfied: a rectangular block is selected as a processing target PU (itis determined to be YES in Step S701); the intra-prediction modecurrently selected in Step S703 is one of the intra-prediction modeswith mode No. 2 to mode No. 9 and mode No. 33 to mode No. 27 describedin FIG. 4; and an adjacent pixel can be set in a pixel position in anopposite prediction direction due to extension processing beingperformed by the adjacent-pixel-line extension unit 601 (that is, thepixel position is within an original image), the opposite predictiondirection being a prediction direction opposite to an originalprediction direction that corresponds to the intra-prediction modecurrently selected in Step S703.

When it has been determined to be YES in Step S704, the predictiondirection determination unit 602 performs the operation of Step 1described in FIG. 4. Accordingly, the prediction direction determinationunit 602 calculates a distance between a prediction target pixel in theprocessing target PU and an adjacent pixel in the original predictiondirection, and a distance between the prediction target pixel in theprocessing target PU and an adjacent pixel in the opposite predictiondirection (Steps S705, S706). A sum of distances between all of theprediction target pixels in the processing target PU and adjacent pixelsin the original prediction direction and respective adjacent pixels inthe original prediction direction, and a sum of distances between all ofthe prediction target pixels in the processing target PU and respectiveadjacent pixels in the opposite prediction direction are calculated asthe above-described distances.

FIG. 8 is a diagram for explaining an operation of calculating adistance performed by the prediction direction determination unit 602.Here, a simple specific example is described. With respect tointra-prediction modes other than the intra-prediction mode in theexample described below, a sum of distances between all of theprediction target pixels in a processing target PU and respectiveadjacent pixels can also be calculated in accordance with standards.

It is assumed that a processing target PU has a rectangular shape havinga size of [X,Y] (X<Y). A line of left adjacent pixels and a line ofupper adjacent pixels that have been extended by the adjacent-pixel-lineextension unit 601 (Step S702) are respectively defined by Formula (3)and Formula (4).Line of left adjacent pixels: P[−1,−1],P[−1,0],P[−1,1], . . .,P[−1,XX]  (3)Line of upper adjacent pixels: P[−1,−1],P[0,−1],P[1,−1], . . .,P[YY,−1]  (4)

Here, XX and YY are determined according to the magnitude relationshipbetween X and Y. When an adjacent pixel is read as in the past, XX=2X+1and YY=2Y+1. However, in the embodiments, the extension processingdescribed in FIG. 4 is performed for a prediction direction, in which asmany additional upper adjacent pixels as is needed to perform theintra-predictions with mode No. 3

to mode No. 9

, or as many additional left adjacent pixels as is needed to perform theintra-predictions with mode No. 33

to mode No. 27

are read. In order to perform a calculation for the prediction mode withmode No. 9

or mode No. 27

, there is a need fora largest increase in the number of adjacent pixelsto be read (a widest extension of a line of adjacent pixels). In thiscase, an exact number of additional pixels may be calculated using anangle of the prediction mode, or an upper limit for reading an adjacentpixel may be defined such that an adjacent pixel is generated under thecondition that a maximum value of XX for a pixel line extension is 4X+1and P[−1,4X+1] is repeated after exceeding 4X+1.

Further, a prediction target pixel in a processing target PU is definedby Formula (5) below.Prediction target pixel: O[0,0],O[0,1], . . . , O[X−1,Y−1]  (5)

For example, it is assumed that the original prediction direction of theintra-prediction mode selected in Step S703 is a direction from lowerleft with an angle of 225 degrees. It is also assumed that the oppositeprediction direction that is opposite to the original predictiondirection is a direction from upper right with an angle of 45 degrees.

In this example, a sum D_(left) of distances between all of theprediction target pixels in the processing target PU and respective leftadjacent pixels in the original prediction direction is calculated inStep S705 using Formula (6) below. Here, “|P(−1, i+j+1),O(i,j)|”indicates a calculation to obtain a pixel-position distance between anadjacent pixel P(−1,i+j+1) and a prediction target pixel O(i,j).

$\begin{matrix}{D_{left} = {\sum\limits_{j}^{Y}{\sum\limits_{i}^{X}{{{P\left( {{- 1},{i + j + 1}} \right)},{O\left( {i,j} \right)}}}}}} & (6)\end{matrix}$

In the above example, a sum D_(upper) of distances between all of theprediction target pixels in the processing target PU and respectiveupper adjacent pixels in the opposite prediction direction is calculatedin Step S706 using Formula (7) below. Here, “|P(i+j+1,−1),O(i,j)|”indicates a calculation to obtain a pixel position distance between anadjacent pixel P(i+j+1,−1) and a prediction target pixel O(i,j).

$\begin{matrix}{D_{upper} = {\sum\limits_{j}^{Y}{\sum\limits_{i}^{X}{{{P\left( {{i + j + 1},{- 1}} \right)},{O\left( {i,j} \right)}}}}}} & (7)\end{matrix}$

Next, the prediction direction determination unit 602 determines whetherthe sum of distances corresponding to the opposite prediction directionthat is calculated in Step S706 is smaller than the sum of distancescorresponding to the original prediction direction that is calculated inStep S705 (Step S707). Here, it is determined whether adjacent pixels inthe opposite prediction direction are situated on average closer to theprocessing target PU than adjacent pixels in the original predictiondirection.

When it has been determined to be YES in Step S707, the intra-predictionmode determination unit 603 of FIG. 6 refers to an adjacent pixel in theopposite prediction direction that is opposite to the originalprediction direction of the intra-prediction mode selected in Step S703.Then, according to the adjacent pixel to which the intra-prediction modedetermination unit 603 referred, the intra-prediction mode determinationunit 603 determines a tentative prediction value of each predictiontarget pixel in the processing target PU, so as to generate thetentative prediction target image PU described above (Step S708).

When it has been determined to be NO in Step S707, or when it has beendetermined to be NO in Step S704 described above because it is notpossible to use an opposite prediction direction that is opposite to anoriginal prediction direction corresponding to a currentintra-prediction mode, the intra-prediction mode determination unit 603performs the following processing. The intra-prediction modedetermination unit 603 refers to an adjacent pixel in the originalprediction direction of the intra-prediction mode selected in Step S703.Then, according to the adjacent pixel to which the intra-prediction modedetermination unit 603 referred, the intra-prediction mode determinationunit 603 determines a tentative prediction value of each predictiontarget pixel in the processing target PU, so as to generate thetentative prediction target image PU described above (Step S709).

Next, the intra-prediction mode determination unit 603 calculates asum-of-absolute differences SAD_cost between a pixel in an originalimage PU and a corresponding pixel in the tentative prediction image PUgenerated in Step S708 or S709, using Formula (1) described above.Further, the intra-prediction mode determination unit 603 calculates acost value (“cost” value) that corresponds to a current intra-predictionmode selected in Step S703, using Formula (2) described above by use ofthe calculated sum-of-absolute differences SAD_cost. Then, theintra-prediction mode determination unit 603 determines whether the costvalue calculated this time is smaller than each of the cost values forthe intra-prediction modes preciously selected in Step S703. When it hasbeen determined to be YES, the intra-prediction mode determination unit603 determines the current intra-prediction mode selected in Step S703to be a tentative output value of an intra-prediction mode thatcorresponds to the current processing target PU. Further, theintra-prediction unit 604 of FIG. 6 determines the tentative predictionimage PU generated in Step S708 or S709 for the current intra-predictionmode to be a tentative output value of a prediction image PU obtained byperforming the intra-prediction that corresponds to the currentprocessing target PU (Step S710).

Next, the controller (not illustrated) determines whether a series ofprocesses including Steps S703 to S710 described above has beenperformed on all of the selectable intra-prediction modes (such as the35 intra-prediction modes illustrated in FIG. 2 in the case of HEVC)(Step S711).

When it has been determined to be NO in Step S711, the process returnsto Step S703, and the series of processes including Steps S703 to S710is performed on a next intra-prediction mode.

When it has been determined to be YES in Step S711, a tentative outputvalue of an intra-prediction mode that is output by the intra-predictionmode determination unit 603 at this point is determined to be an outputvalue of an intra-prediction mode finally determined for the currentprocessing target PU. Further, a tentative output value of a predictionimage PU that is output by the intra-prediction unit 604 at this pointis determined to be an output value of a prediction image PU obtained byperforming an intra-prediction finally determined for the currentprocessing target PU.

Next, the controller (not illustrated) determines whether a series ofprocesses including Steps S701 to S711 described above has beenperformed on all of the processing target PUs obtained by dividing theprocessing target CU (refer to FIG. 5) (Step S712).

When it has been determined to be NO in Step S712, the process returnsto Step S701, and the series of processes including Steps S701 to S711is performed on a next processing target PU in the processing target CU.

When it has been determined to be YES in Step S712, the determination ofan intra-prediction mode and the generation of a prediction image PUobtained by performing an intra-prediction that uses theintra-prediction mode have been completed with respect to all of theprocessing target PUs in the processing target CU, and a predictionimage CU that corresponds to the current processing target CU isdetermined.

Then, block encoding processing is performed on the processing target CU(Step S713). In Step S713, the following series of processing isperformed.

First, the mode determination unit 607 of FIG. 6 receives, from themotion compensation unit 606, an input of a prediction image CU obtainedby combining prediction image PUs obtained by performing aninter-prediction into one CU, the prediction image PUs having beengenerated by the above-described inter-prediction processing beingperformed by the motion vector detector 605 and the motion compensationunit 606. Further, the mode determination unit 607 receives an input ofa prediction image CU that is output from the intra-prediction unit 604as a result of repeating the processes until Step S712 as describedabove, the prediction image CU being obtained by combining predictionimage PUs obtained by performing an intra-prediction into one CU. Themode determination unit 607 compares the prediction image CU obtained byperforming the inter-prediction with the prediction image CU obtained byperforming the intra-prediction. The mode determination unit 607determines, from the comparison, which of the inter-prediction and theintra-prediction is more appropriate to encode the current processingtarget CU. Then, the mode determination unit 607 transmits theprediction image CU obtained by performing the prediction that has beendetermined to be more appropriate to the residual calculator 609 via theprediction image generator 608.

The residual calculator 609 of FIG. 6 calculates a difference betweeneach pixel in an original image CU that corresponds to the currentprocessing target CU and a corresponding pixel in the prediction imageCU received from the prediction image generator 608, so as to generate aprediction residual image CU.

The above-described encoding processing is performed by the orthogonaltransform/quantization unit 610 and the variable length coding unit 611of FIG. 6 on each TU (refer to FIG. 5) of the prediction residual imageCU, so as to output encoded image information that corresponds to theprocessing target CU.

Further, as described above, the inverse quantization/inverse orthogonaltransform unit 612 of FIG. 6 generates a locally decoded image, and thereference image calculator 613 of FIG. 6 accumulates the locally decodedimages in the frame memory 614.

When the series of processes in Step S713 described above has beencompleted, the encoding processing in the flowchart of FIG. 7 that isperformed by the video encoding device 600 of FIG. 6 is terminated.

Next, another embodiment of the distance calculation processingperformed in Steps S705 and S706 of FIG. 7 is described. The example inwhich a sum of distances between all of the prediction target pixels ina processing target PU and respective adjacent pixels in an originalprediction direction, and a sum of distances between all of theprediction target pixels in the processing target PU and respectiveadjacent pixels in an opposite prediction direction and are calculatedas the distances calculated in Steps S705 and S706 has been described.On the other hand, a sum of distances between prediction target pixelson the upper left corner and on the lower right corner in a processingtarget PU and respective adjacent pixels in the original predictiondirection, and a sum of distances between the prediction target pixelson the upper left corner and on the lower right corner in the processingtarget PU and respective adjacent pixels in the opposite predictiondirection may be calculated as the distances calculated in Steps S705and S706. In this case, Formula (6) and Formula (7) described above arerespectively replaced with Formula (8) and Formula (9) below in theexample indicated by the description of Step S703.D _(left) =|P(−1,+1),O(0,0)|+|P(−1,X+Y−1),O(X−1,Y−1)|  (8)D _(upper) =|P(1,−1),O(0,0)|+|P(X+Y−1,−1),O(X−1,Y−1)|  (9)

As represented by Formula (8) and Formula (9) described above, adistance-calculation amount can be reduced by using only predictiontarget pixels on the upper left corner and on the lower right corner ina processing target PU to calculate a distance.

In order to further reduce the calculation amount, a distance between aprediction target pixel on the lower right corner in a processing targetPU and a respective adjacent pixel in the original prediction direction,and a distance between the prediction target pixel on the lower rightcorner in the processing target PU and a respective adjacent pixel inthe opposite prediction direction may be calculated as the distancescalculated in Steps S705 and S706.

FIG. 9 is a block diagram that illustrates an example of a configurationof a video decoding device according to the embodiments. A videodecoding device 900 illustrated in FIG. 9 includes a variable lengthdecoding unit 901, a mode decoder 902, an adjacent-pixel-line extensionunit 903, a prediction direction determination unit 904, anintra-prediction unit 905, a motion compensation unit 906, and aprediction image generator 907. The video decoding device 900 furtherincludes a prediction residual decoder 908, an inversequantization/inverse orthogonal transform unit 909, a decoded imagecalculator 910, and a frame memory 911.

In FIG. 9, first, the variable length decoding unit 901 performsvariable length decoding processing on an encoded image input from aninput unit (not illustrated). As a result, the variable length decodingunit 901 outputs code information on a prediction residual signal to theprediction residual decoder 908, and outputs the other information tothe mode decoder 902.

For each of the processing target CUs described in FIG. 5, the modedecoder 902 determines, from the code information received from thevariable length decoding unit 901, which of an inter-prediction and anintra-prediction is applied to the processing target CU. When the modedecoder 902 has determined that the inter-prediction is applied to acurrent processing target CU, the mode decoder 902 decodes informationon a motion vector from the code information received from the variablelength decoding unit 901, and inputs the decoded information on a motionvector to the motion compensation unit 906 so as to operate the motioncompensation unit 906. When the mode decoder 902 has determined that theintra-prediction is applied to the current processing target CU, themode decoder 902 decodes information on an intra-prediction mode fromthe code information received from the variable length decoding unit901, and inputs the decoded information on an intra-prediction mode tothe adjacent-pixel-line extension unit 903 so as to operate theadjacent-pixel-line extension unit 903, the prediction directiondetermination unit 904, and the intra-prediction unit 905.

As described above, when the mode decoder 902 has determined that theinter-prediction has been applied to the current processing target CU,the motion compensation unit 906 operates. First, the motioncompensation unit 906 decodes a motion vector from the received encodedimage for each processing target PU obtained by dividing the processingtarget CU, and performs a motion compensation according to the motionvector. The motion compensation unit 906 reads a reference image readfrom the frame memory 911, cuts a processing target CU out of thereference image, and cuts a reference image PU out of the processingtarget CU, the reference image PU corresponding to a processing targetPU obtained by dividing the processing target CU. The motioncompensation unit 906 applies the decoded motion vector to the referenceimage PU. Accordingly, the motion compensation unit 906 generates aprediction image PU corresponding to a current processing target PU anddetermines the prediction image PU to be a prediction image PU on whichthe inter-prediction has been performed. The motion compensation unit906 combines all of the prediction image PUs of the entire processingtarget CU, so as to generate a prediction image CU obtained byperforming the inter-prediction on the processing target CU and tooutput the prediction image CU, each prediction image PU being obtainedby performing the inter-prediction for each processing target PU.

On the other hand, as described above, when the variable length decodingunit 901 has determined that the intra-prediction has been applied tothe current processing target CU, the adjacent-pixel-line extension unit903, the prediction direction determination unit 904, and theintra-prediction unit 905 operate.

First, the adjacent-pixel-line extension unit 903 performs an operationsimilar to the operation performed by the adjacent-pixel-line extensionunit 601 of FIG. 6. When a processing target PU obtained by dividing aprocessing target CU is a rectangular block, the adjacent-pixel-lineextension unit 903 performs the following processing. When therectangular block has a horizontally long shape, the adjacent-pixel-lineextension unit 903 extends a line of upper adjacent pixels of therectangular block up to a pixel included in an upper block that isadjacent to an extension obtained by extending a long side of therectangular block in a horizontally right direction (refer to thedescription of FIG. 4). When the rectangular block has a vertically longshape, the adjacent-pixel-line extension unit 903 extends a line of leftadjacent pixels of the rectangular block up to a pixel included in aleft block that is adjacent to an extension obtained by extending a longside of the rectangular block in a vertically downward direction. As anadjacent pixel value, the adjacent-pixel-line extension unit 903 uses avalue of a pixel in a corresponding position of the decoded referenceimage read from the frame memory 911.

Next, the prediction direction determination unit 904 receives an inputof information on a decoded intra-prediction mode from the mode decoder902 via the adjacent-pixel-line extension unit 903, the decodedintra-prediction mode corresponding to a current processing target PUobtained by dividing the processing target CU. When the processingtarget PU is a rectangular block, the prediction direction determinationunit 904 performs the operations of Steps 1, 2, and 3 described in FIG.4 using the adjacent pixel value set by the adjacent-pixel-lineextension unit 903, so as to select one of an original predictiondirection corresponding to the decoded prediction mode and its oppositeprediction direction.

The intra-prediction unit 905 refers to an adjacent pixel in anintra-prediction direction based on the determination performed by theprediction direction determination unit 904 with respect to the decodedintra-prediction mode described above. Next, the intra-prediction unit905 determines a prediction value of each prediction target pixel of theprocessing target PU from the adjacent pixel to which theintra-prediction unit 905 referred, and generates a prediction image PU.The intra-prediction unit 905 combines all of the prediction image PUsof the entire processing target CU, so as to generate a prediction imageCU obtained by performing an intra-prediction on the processing targetCU and to output the prediction image CU, each prediction image PU beingobtained by performing an intra-prediction for each processing targetPU.

The prediction image generator 907 outputs the prediction image CU inputfrom the motion compensation unit 906 or the intra-prediction unit 905to the decoded image calculator 910.

The prediction residual decoder 908 decodes a prediction residual signalfrom the encoded information input from the variable length decodingunit 901, and outputs the decoded prediction residual signal to theinverse quantization/inverse orthogonal transform unit 909.

The inverse quantization/inverse orthogonal transform unit 909 performs,for each TU obtained by dividing the processing target CU (refer to FIG.5), an inverse quantization on the prediction residual signal in thespatial frequency domain that is input from the prediction residualdecoder 908, and further performs an inverse orthogonal transform on afrequency component on which an inverse quantization has been performed,so as to transform the frequency component into a decoded predictionresidual image.

The decoded image calculator 910 combines the decoded predictionresidual image TUs for each processing target CU (hereinafter referredto as a “prediction residual image CU”), and adds each pixel in theprediction residual image CU to a corresponding pixel in the predictionimage CU input from the prediction image generator 608. As a result, thedecoded image calculator 910 decodes a decoded image for each CU(hereinafter referred to as a “decoded image CU”), and further combinesthe decoded image CUs into one frame image, so as to output the frameimage as a decoded frame image and to accumulate the decoded frameimages in the frame memory 911 as decoded reference images.

FIG. 10 is a flowchart that illustrates an example of decodingprocessing that is focused on an intra-prediction and is performed bythe video decoding device 900 of FIG. 9. The flowchart is describedbelow referring to each component of FIG. 9 as needed.

First, the adjacent-pixel-line extension unit 903 determines whether themode decoder 902 has determined that an intra-prediction has beenapplied to a current processing target CU, and determines whether acurrent processing target PU obtained by dividing the processing targetCU is a rectangular division PU or not (a square division PU) (StepS1001). When a conventional coding scheme before HEVC is applied, orwhen all of the units on which an intra-prediction is to be performedhave a square shape even if the QTBT block partitioning is used, it isdetermined to be NO.

When it has been determined to be YES in Step S1001, theadjacent-pixel-line extension unit 903 performs the above-describedprocessing of extending a line of adjacent pixels (Step S1002).

Next, with respect to a decoded intra-prediction mode input from themode decoder 902, the prediction direction determination unit 904determines whether it is possible to use an opposite predictiondirection (abbreviated to “opposite direction” in FIG. 10) that isopposite to an original prediction direction that corresponds to theintra-prediction mode. It will be determined to be YES if all of thefollowing conditions are satisfied: an intra-prediction mode is appliedto a processing target PU and a rectangular block is selected as theprocessing target PU (it is determined to be YES in Step S1001); thedecoded intra-prediction mode is one of the intra-prediction modes withmode No. 2 to mode No. 9 and mode No. 33 to mode No. 27 described inFIG. 4; and an adjacent pixel can be set in a pixel position in anopposite prediction direction due to extension processing beingperformed by the adjacent-pixel-line extension unit 903 (that is, thepixel position is within an original image), the opposite predictiondirection being opposite to an original prediction direction thatcorresponds to the decoded intra-prediction mode.

When it has been determined to be YES in Step S1003, the predictiondirection determination unit 904 performs the operation of Step 1described in FIG. 4. Accordingly, the prediction direction determinationunit 904 calculates a distance between a prediction target pixel in theprocessing target PU and an adjacent pixel in the original predictiondirection, and a distance between the prediction target pixel in theprocessing target PU and an adjacent pixel in the opposite predictiondirection (Steps S1004, S1005). These processes are similar to theprocesses of Steps 705 and 706 of FIG. 7 performed in the video encodingdevice 600 of FIG. 6. A sum of distances between all of the predictiontarget pixels in the processing target PU and respective adjacent pixelsin the original prediction direction, and a sum of distances between allof the prediction target pixels in the processing target PU andrespective adjacent pixels in the opposite prediction direction arecalculated as the above-described distances (refer to the description ofFIG. 8). Further, as described above, a sum of distances betweenprediction target pixels on the upper left corner and on the lower rightcorner in a processing target PU and respective adjacent pixels in theoriginal prediction direction, and a sum of distances between theprediction target pixels on the upper left corner and on the lower rightcorner in the processing target PU and respective adjacent pixels in theopposite prediction direction may be calculated as the distancescalculated in Steps S1004 and S1005. Furthermore, as described above, adistance between a prediction target pixel on the lower right corner ina processing target PU and a respective adjacent pixel in the originalprediction direction, and a distance between the prediction target pixelon the lower right corner in the processing target PU and a respectiveadjacent pixel in the opposite prediction direction may be calculated asthe distances calculated in Steps S1004 and S1005. However, there is aneed to apply distance-calculation criteria similar to those applied tothe processes of Steps S705 and S706 in FIG. 7 performed in the videoencoding device 600 of FIG. 6.

Next, the prediction direction determination unit 904 determines whetherthe sum of distances corresponding to the opposite prediction directionthat is calculated in Step S1005 is smaller than the sum of distancescorresponding to the original prediction direction that is calculated inStep S1004 (Step S1006). The determination is similar to that performedin Step S707 of FIG. 7.

When it has been determined to be YES in Step S1006, theintra-prediction unit 905 of FIG. 9 refers to an adjacent pixel in theopposite prediction direction that is opposite to the originalprediction direction of the decoded intra-prediction mode. Then,according to the adjacent pixel to which the intra-prediction unit 905referred, the intra-prediction unit 905 determines a prediction value ofeach prediction target pixel in the processing target PU, so as togenerate a prediction target image PU (Step S1007).

When it has been determined to be NO in Step S1006, or when it has beendetermined to be NO in Step S1003 described above because it is notpossible to use the opposite prediction direction that is opposite tothe original prediction direction of the decoded intra-prediction mode,the intra-prediction unit 905 performs the process of Step S1008.Alternatively, the intra-prediction unit 905 also performs the processof Step S1008 when an intra-prediction mode is not applied to theprocessing target PU or when the processing target PU is not arectangular block and it has been determined to be NO in Step S1001described above. In Step S1008, the intra-prediction unit 905 refers toan adjacent pixel in the original prediction direction of the decodedintra-prediction mode. Then, according to the adjacent pixel to whichthe intra-prediction unit 905 referred, the intra-prediction unit 905determines a prediction value of each prediction target pixel in theprocessing target PU, so as to generate a prediction target image PU(Step S1008).

Next, a controller (not illustrated) determines whether a series ofprocesses including Steps S1001 to S1008 described above has beenperformed on all of the processing target PUs obtained by dividing theprocessing target CU (refer to FIG. 5) (Step S1009).

When it has been determined to be NO in Step S1009, the process returnsto Step S1001, and the series of processes including Steps S1001 toS1008 is performed on a next processing target PU in the processingtarget CU.

When it has been determined to be YES in Step S1009, the generation of aprediction image PU obtained by performing an intra-prediction that usesthe decoded intra-prediction mode has been completed with respect to allof the processing target PUs in the processing target CU, and aprediction image CU that corresponds to the current CU is determined.

Then, block decoding processing is performed on the processing target CU(Step S1010). In Step S1010, the block decoding processing is performedby the prediction residual decoder 908, the inverse quantization/inverseorthogonal transform unit 909, and the decoded image calculator 910 foreach TU obtained by dividing the processing target CU. As a result, thedecoded image calculator 910 decodes a decoded image CU that correspondsto the processing target CU, and further combines the decoded image CUsinto one frame image, so as to output the frame image as a decoded frameimage and to accumulate the decoded frame images in the frame memory 911as decoded reference images.

When the series of processes in Step S1010 described above has beencompleted, the decoding processing in the flowchart of FIG. 10 that isperformed by the video decoding device 900 of FIG. 9 is terminated.

FIG. 11 is an example of a hardware configuration of a computer that canbe implemented as the video encoding device 600 of FIG. 6 or the videodecoding device 900 of FIG. 9.

The computer illustrated in FIG. 11 includes a central processing unit(CPU) 1101, a memory 1102, an input device 1103, an output device 1104,an auxiliary storage 1105, a medium driving device 1106 into which aportable recording medium 1109 is inserted, and a network connectingdevice 1107. These components are connected to one another via a bus1108. The configuration illustrated in FIG. 11 is an example of aconfiguration of a computer that can be implemented as the videoencoding device 600 or the video decoding device 900 described above,and such a computer is not limited to this configuration.

The memory 1102 is, for example, a semiconductor memory such as a readonly memory (ROM), a random access memory (RAM), or a flash memory, andstores a program and data used to perform processing.

For example, the CPU 1101 (a processor) operates as each functionillustrated in FIG. 6 or 9 by executing a program by use of the memory1102, the program corresponding to, for example, the processing in theflowchart of FIG. 7 applied to the video encoding device 600 of FIG. 6or corresponding to, for example, the processing in the flowchart ofFIG. 10 applied to the video decoding device 900 of FIG. 9.

The input device 1103 is, for example, a keyboard or a pointing device,and is used for inputting instructions or information from an operatoror a user. The output device 1104 is, for example, a display, a printer,or a speaker, and is used for outputting inquiries to the operator orthe user or for outputting a result of processing.

The auxiliary storage 1105 is, for example, a hard disk storage, amagnetic disk device, an optical disk device, a magneto-optical diskdevice, a tape device, or a semiconductor storage device. The videoencoding device 600 of FIG. 6 or the video decoding device 900 of FIG. 9stores, in the auxiliary storage 1105, a program and data so as to loadthem into the memory 1102 and use them, the program and the data beingused to execute, for example, the processing in the flowchart of FIG. 7applied to the video encoding device 600 of FIG. 6 or being used toexecute, for example, the processing in the flowchart of FIG. 10 appliedto the video decoding device 900 of FIG. 9.

The medium driving device 1106 drives the portable recording medium 1109so as to access the recorded content. The portable recording medium 1109is, for example, a memory device, a flexible disk, an optical disk, or amagneto-optical disk. The portable recording medium 1109 may be, forexample, a compact disk read only memory (CD-ROM), a digital versatiledisk (DVD), or a universal serial bus (USB) memory. The operator or theuser can store the program and the data described above in the portablerecording medium 1109 so as to load them into the memory 1102 and usethem.

As described above, a computer-readable recording medium that storestherein the program and the data described above is a physical(non-transitory) recording medium such as the memory 1102, the auxiliarystorage 1105, or the portable recording medium 1109.

The network connecting device 1107 is a communication interface that isconnected to a communication network such as a local area network (LAN)and makes a data conversion associated with communication. The videoencoding device 600 of FIG. 6 or the video decoding device 900 of FIG. 9can also receive the program or the data described above from anexternal device via the network connecting device 1107 so as to loadthem into the memory 1102 and use them.

The video encoding device 600 of FIG. 6 or the video decoding device 900of FIG. 9 does not necessarily include all of the components in FIG. 11,and some of the components can be omitted according to the applicationsor the requirements. For example, when there is no need to inputinstructions or information from the operator or the user, the inputdevice 1103 may be omitted. When the portable recording medium 1109 orthe communication network is not used, the medium driving device 1106 orthe network connecting device 1107 may be omitted.

In the embodiments described above, when a processing target block has anon-square shape, it is determined which of an intra-prediction in anoriginal prediction direction and an intra-prediction in an oppositeprediction direction makes it possible to perform an intra-predictionfrom a closer prediction image, so as to realize an intra-predictionwithout increasing the number of prediction modes. This results in beingable to perform encoding more efficiently with respect to anintra-prediction performed on a rectangular block.

In the embodiments described above, a prediction direction that isopposite to an original prediction direction is a determination targetprediction direction, but it is not limited to the opposite direction.Depending on a method for obtaining a prediction pixel that is used togenerate a prediction pixel (a method defined by, for example, astandard), a direction that corresponds to an angle of approximately 180degrees, not exactly 180 degrees may be a determination targetprediction direction.

Further, if the conditions are satisfied, the number of intra-predictionmodes corresponding to an opposite prediction direction may be increasedso as to encode information on an added intra-prediction mode.

The embodiments of the present invention described above are applied toprocessing of encoding and decoding a video, but they are alsoapplicable to a still image.

The disclosed embodiments and their advantages have been described indetail, but various modifications, additions, and omissions may be madeby persons skilled in the art without departing from the scope of theinvention specified in the claims.

All examples and conditional language provided herein are intended forpedagogical purposes to aiding the reader in understanding the inventionand the concepts contributed by the inventor to further the art, and arenot to be construed as being limitations to such specifically recitedexamples and conditions, nor does the organization of such examples inthe specification relate to a showing of the superiority and inferiorityof the invention. Although one or more embodiments of the presentinvention have been described in detail, it should be understood thatthe various changes, substitutions, and alterations could be made heretowithout departing from the spirit and scope of the invention.

What is claimed is:
 1. A video decoding method for performing anintra-prediction that is associated with a prediction mode when videodecoding is performed, the video decoding method comprising: when aprediction mode is used that corresponds to an intra-prediction that isperformed on a processing target unit having a rectangular shape,determining, by a processor, whether a prediction mode from an originalintra-prediction direction or from an opposite intra-predictiondirection opposite to the original intra-prediction direction is to beused to perform an intra-prediction from a closer adjacent pixel withrespect to a selected intra-prediction mode; and performing, by theprocessor, an intra-prediction using the prediction mode from thedetermined intra-prediction direction.
 2. The video decoding methodaccording to claim 1, wherein the prediction mode generates a predictionimage that corresponds to the original intra-prediction direction, andthe determining is performed further when the prediction mode from theoriginal intra-prediction direction is available and when a calculationfor the intra-prediction using the prediction mode from the oppositeintra-prediction direction is possible.
 3. A video encoding method forperforming an intra-prediction that is associated with a prediction modewhen video encoding is performed, the video encoding method comprising:determining, by a processor, whether a processing target unit on whichan intra-prediction is performed has a rectangular shape; when anintra-prediction has been determined to be performed on a rectangularblock, determining, by the processor, whether a prediction mode from anoriginal intra-prediction direction or from an opposite intra-predictiondirection opposite to the original intra-prediction direction is to beused to perform an intra-prediction from a closer adjacent pixel; anddetermining, by the processor, the prediction mode from the determinedintra-prediction direction.
 4. The video encoding method according toclaim 3, wherein the prediction mode generates a prediction image thatcorresponds to the original intra-prediction direction, and thedetermined intra-prediction direction is determined further when theprediction mode from the original intra-prediction direction isavailable and when a calculation for the intra-prediction using theprediction mode from the opposite intra-prediction direction ispossible.